<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!-- saved from url=(0049)http://web.hand999.com/daili_mobile/creatuser.php -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>商户管理系统</title>
<meta name="Keywords" content="">
<meta name="Description" content="">

<link href="/admin/agent_admin/Public/home/css/mui.picker.css" rel="stylesheet">
<link href="/admin/agent_admin/Public/home/css/mui.poppicker.css" rel="stylesheet">
<meta http-equiv="Cache-Control" content="no-cache">
<meta name="MobileOptimized" content="240">

<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">        
<!-- Mobile Devices Support @begin -->
  
  <meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
  <meta content="no-cache" http-equiv="pragma">
  <meta content="0" http-equiv="expires">
  <meta content="telephone=no, address=no" name="format-detection">
  <meta name="apple-mobile-web-app-capable" content="yes"> <!-- apple devices fullscreen -->
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Mobile Devices Support @end -->
<link rel="stylesheet" type="text/css" href="/admin/agent_admin/Public/home/css/public.css" media="all">
<link rel="stylesheet" type="text/css" href="/admin/agent_admin/Public/home/css/style.css" media="all">
<script src="/admin/agent_admin/Public/home/js/jquery-2.1.0.min.js.下载"></script>
<style type="text/css">
	.pop_msg{width:80%; padding:10px 5% 15px 5%; font-size:1.15em; line-height:24px; text-align:left; background-color:#FFF; position:fixed; left:5%; top:50%; margin-top:-50%; z-index:99999; display:none;}
	.pop_msg span{font-weight:bold; padding-top:10px; padding-bottom:5px; display:inline-block;}
	
	.op_reg{height:120px; margin-top:-60px; line-height:40px;}
	.op_reg span{font-size:1.15em;}
	.op_reg em{color:#FF0; font-weight:bold;}
	.op_reg a{font-size:1.1em; color:#FF0;}
</style>
</head>
<!-- <table id="Bq"><tr><td id="stWrap"></td></tr></table><script src="//www.speedtest.cn/assets/js/api/speedtest.dark_nobg.min.js"></script> -->
<body class="body">
	<div class="page_top_box">
    <center>
        <div class="page_top">
            <a href="javascript:void(0)" onclick="history.go(-1)" class="back"><img src="/admin/agent_admin/Public/home/images/ico_back.png"></a>
                        <a id="help" href="javascript:void(0)" class="help">?</a>
                        <div class="pg_name" onclick="location.reload()">添加代理</div>
        </div>
    </center>
    </div>
				<?php	foreach($users as $k=>$v){ ?>
				<?php } ?>
        <div class="put_box">
        	<div class="put" style="height:auto; overflow:hidden;">
        	<label class="lb">分享链接：</label>									
            <textarea class="txt" readonly="" style="height:50px; overflow:hidden;">101.37.81.210/agent_admin/index.php/Home/Index/addition.html?referrer=<?php echo $v['accounts'] ?></textarea>
        </div>
		   <form id="myform" name="form1" method="post" action="<?php echo U('Home/Index/creatuser') ?>" onsubmit="return doValidate()">  
			<div class="put">
				<label class="lb">代理类型：</label>
				<?php if($v['agencylv']<1){ echo '
				<select id="type" name="agencylv">
				<option value="1">一级代理</option>
				<option value="2">普通代理</option>
				</select>'; } if($v['agencylv']>=1){ echo '
				<select id="type" name="agencylv">
				<option value="2">普通代理</option>
				</select>'; } ?>
			</div>
        <div class="put">
        	<label class="lb">游戏类型：</label>
            <span id="gtype1" name="game" value="1" data-id="1" data-value="1" class="game a c">温州麻将</span>
				<b style="color:#F00"> 温馨提示：带*为必填</b> 
            <input id="gametype" name="gametype" type="hidden" value="1">
            <!-- <input id="gametype" name="gametype" type="hidden" value="2"> -->
            <!-- <input id="gametype" name="gametype" type="hidden" value="3"> -->
        </div>
     
				<!-- 次输入框只可以输入数字 除了数字只玩不可输入 -->
			<div class="put">
				<label class="lb" style="font-size:14.5px;">手机号：<p style="font-size:10px;width:85px;height:20px;margin-top:-20%">（登录账号）</p></label>
				<input type="text" id="phone" name="phone" value="" maxlength="11" placeholder="输入您的手机号码" class="txt" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')" "/>
			</div>
			<div class="put">
				<label class="lb" style="font-size:14.5px;"><span>*</span>姓　名：</label>
				<input id="rname" name="username" type="text" value="" placeholder="请输入2~4位汉字" class="txt" onblur="checkname(this)">
			</div>        
			<div class="put">
				<label class="lb" style="font-size:14.5px;"><span>*</span>昵　称：</label>
				<input id="nick" name="nickname" type="text" value="" placeholder="请输入汉字" class="txt" onclick="checkni(this)">
			</div>
			<div class="put">
				<label class="lb" style="font-size:14.5px;"><span>*</span>密　码：</label>
				<input id="pword" name="password"  type="password" maxlength="12" placeholder="请至少输入6位密码" value="" class="txt" onclick="checkpwd()">
			</div>
			<div class="put">
				<label class="lb" style="font-size:14.5px;margin-left:-2%"><span>*</span>确认密码：</label>
				<input id="cword" name="passwordd" type="password" maxlength="12" placeholder="请再次输入密码" value="" class="txt">
			</div>

			<!-- <div class="put put1">
				<label class="lb"><span>*</span>验证码：</label>
				<input id="ccode" name="" type="number" value="" class="txt">
				<input id="scode" type="button" value="获取验证码" onclick="sendCode()" class="btn">
			</div> -->

			<div class="put">
				<label class="lb">地　区：</label>
				<input id="region" name="region" type="text" value="" class="txt" readonly="">
				<input id="province" name="province" type="hidden" value="">
				<input id="city" name="city" type="hidden" value="">
				<input id="area" name="city" type="hidden" value="">
			</div>

			<div class="put">
				<label class="lb">推荐人ID：</label>
				<input id="agentid" name="referrer" type="number" value="<?php echo $v['accounts'] ?>" readonly="" class="txt">
			</div>
        
        <div class="btn">
        	<input type="submit" value="确定" class="btn">
        </div>
		</form>
    </div>
    
    <div class="pg_foot_box">
<center>
    <div class="pg_foot">
        <a href="indexx.html">商户管理平台</a>
    </div>
</center>
</div>    
    <div id="popbg" class="pop_box_bg"></div>
    <div id="ophint" class="op_hint">正添加代理，请稍候...</div>
    <div id="reghint" class="op_hint op_reg"><span>注册成功！</span><br><em id="skip">5</em> 秒后自动跳到登录界面...<br><a href="http://web.hand999.com/daili_mobile/login.php">立即登录</a></div>
    
    <div id="msgbg" class="pop_box_bg hmsg" style="display: block;"></div>
    <div id="popmsg" class="pop_msg hmsg" style="display: block;width:27%;left:31.51%;top:135%;margin-top:-56%;">
    	<span>　　添加下属代理方式:</span><br>
        　　1、发展下属代理可复制此页面给下属代理，注册后即可成为您的代理。<br>
    </div>
    
    <div id="hintbox" class="hint_box">
       <span id="hintmsg"></span>
    </div>   
    <script src="/admin/agent_admin/Public/home/js/mui.min.js.下载"></script>
	<script src="/admin/agent_admin/Public/home/js/mui.picker.js.下载"></script>
    <script src="/admin/agent_admin/Public/home/js/mui.poppicker.js.下载"></script>
    <script src="/admin/agent_admin/Public/home/js/city.data.js.下载" type="text/javascript" charset="utf-8"></script>
    <script src="/admin/agent_admin/Public/home/js/city.data-3.js.下载" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
            (function($, doc) {
            $.init();
            $.ready(function() {				
                //					//级联示例
                var cityPicker = new $.PopPicker({
                    layer: 3
                });
                cityPicker.setData(cityData3);
                var showCityPickerButton = doc.getElementById('region');
                var cityResult = doc.getElementById('region');
                showCityPickerButton.addEventListener('tap', function(event) {
                    cityPicker.show(function(items) {
                        cityResult.value = (items[0] || {}).text + " " + (items[1] || {}).text + " " + ((items[2] || {}).text!=undefined?(items[2] || {}).text:'');
                        doc.getElementById("province").value = (items[0] || {}).text;
						doc.getElementById("city").value = (items[1] || {}).text;
						doc.getElementById("area").value = ((items[2] || {}).text!=undefined?(items[2] || {}).text:'');
						//返回 false 可以阻止选择框的关闭
                        //return false;
                    });
                }, false);
            });
        })(mui, document);
        
        mui.init({
            swipeBack:true //启用右滑关闭功能
        });
        mui('.mui-switch').each(function() { //循环所有toggle
            this.addEventListener('toggle', function(event) {
                //event.detail.isActive 可直接获取当前状态
                $("#isdefault").val(event.detail.isActive ? 'Y' : 'N');
            });
        });
    </script>
    
    <script type="text/javascript">
	



	
	
					$("#msgbg").css("display", "block");
			$("#popmsg").css("display", "block");
			
			$("#help").click(function(){
				$("#msgbg").css("display", "block");
				$("#popmsg").css("display", "block");
			});
			$(".hmsg").click(function(){
				$("#popmsg").css("display", "none");
				$("#msgbg").css("display", "none");
			});
		
		$(".game").click(function(){
			if($(this).attr("data-value") == 0){
				$(this).addClass("c");
				$(this).attr("data-value", 1);
			}else{
				$(this).removeClass("c");
				$(this).attr("data-value", 0);
			}
			
			var gtype = "";
			for(var i = 1; i <= 3; i++){
				if($("#gtype" + i).attr("data-value") == 1){
					if(gtype != ""){gtype += ",";}
					gtype += i;
				}
			}
			$("#gametype").val(gtype);
		});
		
		<!-- function sendCode(){ -->
			<!-- var isCheck = false; -->
			
			<!-- if($("#phone").val() == ""){ -->
				<!-- hintPop("请输入手机号！");                 -->
				<!-- return false; -->
            <!-- } -->
			<!-- var parrern = /^\d{11}$$/; -->
			<!-- if (!parrern.test($("#phone").val())) { -->
				<!-- hintPop("手机号格式不正确，请重新输入...");                 -->
				<!-- return false; -->
			<!-- } -->

			<!-- $.ajax({ -->
				<!-- url:"prog.php?ac=ajax.class&do=isphone&phone=" + $("#phone").val() + "&" + Math.random(), -->
				<!-- async:false,  -->
				<!-- success:function (result) { -->
					<!-- if (result == "true") { -->
						<!-- hintPop("该手机号已存在，请重新输入..."); -->
						<!-- return false; -->
					<!-- } else { -->
						<!-- isCheck = true; -->
					<!-- } -->
				<!-- } -->
			<!-- });	 -->

			<!-- if(isCheck == true){ -->
				<!-- $.ajax({ -->
					<!-- url:"function/SendSMS.php?p=" + $("#phone").val() + "&" + Math.random(),  -->
					<!-- success:function(result){ -->
						<!-- if(result == "False"){ -->
							<!-- hintPop("短信发送失败，请检查手机号后重新发送！"); -->
							<!-- return false; -->
						<!-- }else{ -->
							<!-- hintPop("短信发送成功，10分钟内有效"); -->
							<!-- $("#scode").attr({"onclick":"", "class":"btc"}); -->
							<!-- $("#phone").attr("readonly", "readonly"); -->
							<!-- var s = 60; -->
							<!-- $("#scode").val("重新获取(" + s + "s)");	 -->
							<!-- var st = setInterval(function(){ -->
								<!-- s--; -->
								<!-- $("#scode").val("重新获取(" + s + "s)"); -->
								<!-- if(s == -1){ -->
									<!-- clearInterval(st); -->
									<!-- $("#scode").val("重新获取"); -->
									<!-- $("#scode").attr({"onclick":"sendCode()", "class":"btn"}); -->
									<!-- $("#phone").removeAttr("readonly"); -->
									<!-- $("#scode").val("获取验证码"); -->
								<!-- } -->
							<!-- }, 1000); -->
							<!-- return false; -->
						<!-- } -->
					<!-- } -->
				<!-- });	 -->
			<!-- } -->
		<!-- } -->
		
		function checkForm(){
			<!-- var flag = false; -->
			<!-- $.ajax({ -->
				<!-- url:"prog.php?ac=ajax.class&do=agnum&agid=" + $("#agentid").val() + "&" + Math.random(), -->
				<!-- async:false, -->
				<!-- success:function(result){ -->
					<!-- if(result == 1){ -->
						 <!-- flag = true; -->
					<!-- }else{ -->
						<!-- hintPop("推荐人的代理人数已达到上限！");						 -->
						<!-- return false;	 -->
					<!-- } -->
				<!-- } -->
			<!-- }); -->
			
			if(flag == true){
				if($("#gametype").val() == ""){
					hintPop("请选择游戏类型！"); return false;
				}
				if($("#rname").val() == ""){
					hintPop("请输入您的姓名！"); return false;
				}
				if($("#nick").val() == ""){
					hintPop("请输入推广员昵称！"); return false;
				}
				if($("#pword").val() == ""){
					hintPop("请输入密码！"); return false;
				}
				<!-- if($("#cword").val() == ""){ -->
					<!-- hintPop("请输入确认密码！"); return false; -->
				<!-- } -->
				<!-- if($("#pword").val() != $("#cword").val()){ -->
					<!-- hintPop("确认密码与密码不一致，请重新输入..."); -->
					<!-- $("#pword").val(''); $("#cword").val(''); -->
					<!-- return false; -->
				<!-- } -->
				<!-- if($("#phone").val() == ""){ -->
					<!-- hintPop("请输入您的手机号码！"); return false; -->
				<!-- } -->
				if($("#ccode").val() == ""){
					hintPop("请输入验证码！"); return false;
				}
							
				SaveUser();
			}
		}
		
		function SaveUser(){
			$("#popbg").css({"height":$(window).height() + "px", "display": "block"});
			$("#ophint").css("display", "block");
			$.post("prog.php?ac=agent&do=save",
				{
					cmd:"pdkuser",
					timestamp:"1482808717",
					sign:"49472bb5b5f5b0550749b8f0a729373b",
					type:$("#type").val(),
					gtype:$("#gametype").val(),
					rname:$("#rname").val(),
					nick:$("#nick").val(),
					pword:$("#cword").val(),
					phone:$("#phone").val(),
					ccode:$("#ccode").val(),
					prov:$("#province").val(),
					city:$("#city").val(),
					area:$("#area").val(),
					agentid:$("#agentid").val()
				},
				function(data, status){
					if(status == "success"){
						v = $.parseJSON(data);

						if(v.result == 0){							
							hintPop(v.errorMsg);
						}else{
							$("#rname").val('');
														window.location.href="myadmin.php";
							$("#ophint").css("display", "none");
							$("#popbg").css("display", "none");
													}						
						return false;
					}
				}
			);
		}
		
		function hintPop(msg){
			$("#hintmsg").html(msg);
			$("#hintbox").css({"opacity": "1", "display": "block"});
			$("#hintbox").animate({"bottom":"80px"}, "last", function(){
				setTimeout(function(){
					$("#hintbox").animate({"opacity": "0"}, "last", function(){
						$("#hintbox").css({"bottom":"0px", "display": "none"});
					});
				}, 2000);
			});
		}
		
	</script>

<div class="mui-poppicker">		<div class="mui-poppicker-header">			<button class="mui-btn mui-poppicker-btn-cancel">取消</button>			<button class="mui-btn mui-btn-blue mui-poppicker-btn-ok">确定</button>			<div class="mui-poppicker-clear"></div>		</div>		<div class="mui-poppicker-body">		<div class="mui-picker" style="width: 33.3333%;">		<div class="mui-picker-inner">			<div class="mui-pciker-rule mui-pciker-rule-ft"></div>			<ul class="mui-pciker-list" style="transform: perspective(1000px) rotateY(0deg) rotateX(0deg);"><li class="highlight" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(0deg);">北京</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-20deg);">天津</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-40deg);">河北</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-60deg);">山西</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-80deg);">内蒙古</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-100deg);">辽宁</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-120deg);">吉林</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-140deg);">黑龙江</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-160deg);">上海</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-180deg);">江苏</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-200deg);">浙江</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-220deg);">安徽</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-240deg);">福建</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-260deg);">江西</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-280deg);">山东</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-300deg);">河南</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-320deg);">湖北</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-340deg);">湖南</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-360deg);">广东</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-380deg);">广西</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-400deg);">海南</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-420deg);">重庆</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-440deg);">四川</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-460deg);">贵州</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-480deg);">云南</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-500deg);">西藏</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-520deg);">陕西</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-540deg);">甘肃</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-560deg);">青海</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-580deg);">宁夏</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-600deg);">新疆</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-620deg);">台湾</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-640deg);">香港</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-660deg);">澳门</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-680deg);">海外</li></ul>			<div class="mui-pciker-rule mui-pciker-rule-bg"></div>		</div>	</div><div class="mui-picker" style="width: 33.3333%;">		<div class="mui-picker-inner">			<div class="mui-pciker-rule mui-pciker-rule-ft"></div>			<ul class="mui-pciker-list" style="transform: perspective(1000px) rotateY(0deg) rotateX(0deg);"><li class="highlight" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(0deg);">北京市</li></ul>			<div class="mui-pciker-rule mui-pciker-rule-bg"></div>		</div>	</div><div class="mui-picker" style="width: 33.3333%;">		<div class="mui-picker-inner">			<div class="mui-pciker-rule mui-pciker-rule-ft"></div>			<ul class="mui-pciker-list" style="transform: perspective(1000px) rotateY(0deg) rotateX(0deg);"><li class="highlight" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(0deg);">东城区</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-20deg);">西城区</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-40deg);">崇文区</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-60deg);">宣武区</li><li class="visible" style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-80deg);">朝阳区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-100deg);">丰台区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-120deg);">石景山区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-140deg);">海淀区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-160deg);">门头沟区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-180deg);">房山区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-200deg);">通州区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-220deg);">顺义区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-240deg);">昌平区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-260deg);">大兴区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-280deg);">怀柔区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-300deg);">平谷区</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-320deg);">密云县</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-340deg);">延庆县</li><li style="transform-origin: center center -90px; transform: translateZ(90px) rotateX(-360deg);">其它区</li></ul>			<div class="mui-pciker-rule mui-pciker-rule-bg"></div>		</div>	</div></div>	</div></body></html>